using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;

public class AutoRotate : MonoBehaviour
{
    public float speed = 10.0f;
    public GameObject fpsLabel = null;

    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        float smooth = Time.deltaTime * speed;
        this.transform.Rotate(Vector3.up * smooth);

        var fps = (int)(1 / Time.deltaTime);
        fpsLabel.GetComponent<TextMeshProUGUI>().text = "FPS: " + fps.ToString();
    }

    public void Set30FPS()
    {
        Application.targetFrameRate = 30;
    }

    public void Set60FPS()
    {
        Application.targetFrameRate = 60;
    }

    public void SetNoLimit()
    {
        Application.targetFrameRate = -1;
    }
}
